package com.spa.infrastructure.enums.dict.coupon;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.spa.infrastructure.annotation.SysDictEnumAnnotation;
import com.spa.infrastructure.enums.dict.IBaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;


@Getter
@AllArgsConstructor
@SysDictEnumAnnotation(key = "couponComeIntoForceType", desc = "优惠券生效类型")
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum CouponComeIntoForceTypeEnum implements IBaseEnum {

    //生效方式 1：领取后生效，2：固定时间*/
    $1(1, "领取后生效",1,0),
    $2(2, "固定时间",2,0),

    ;

    private Integer code;
    private String desc;
    //排序
    private Integer sort;
    //状态  0 启用  1 不启用
    private Integer status;


    public static CouponComeIntoForceTypeEnum byCode(int code) {
        for (CouponComeIntoForceTypeEnum value : values()) {
            if (value.code == code) return value;
        }
        return null;
    }

}
